package io.babystar.modules.business.service.impl;

import io.babystar.common.utils.PageUtils;
import io.babystar.common.utils.Query;
import io.babystar.modules.business.dao.CwFinancialDetailsDao;
import io.babystar.modules.business.entity.CwFinancialDetailsEntity;
import io.babystar.modules.business.service.CwFinancialDetailsService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


@Service("cwFinancialDetailsService")
public class CwFinancialDetailsServiceImpl extends ServiceImpl<CwFinancialDetailsDao, CwFinancialDetailsEntity> implements CwFinancialDetailsService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String orderId = (String) params.get("key");
        IPage<CwFinancialDetailsEntity> page = this.page(
                new Query<CwFinancialDetailsEntity>().getPage(params),
                new QueryWrapper<CwFinancialDetailsEntity>()
                        .eq(StringUtils.isNotBlank(orderId),"order_id",orderId)
        );

        return new PageUtils(page);
    }

}